<%--
  Created by IntelliJ IDEA.
  User: mercu
  Date: 2019/4/6
  Time: 15:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--导入el表达式需要文件--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript" src="/js/jquery-2.1.1.min.js"></script>
<html>
<head>
    <title>jsp viewResolver's test jsp</title>
    <script>
        function login(){
            $.ajax({
                type : "POST",
                url : "/loginController/login",
                data : $("#loginForm").serialize(),
                dataType : "json",
                success : function(data) {
                    if (data.result == "1") {
                        window.location.href ="/jspController/jumpToJsp";
                    } else {
                        alert("账号密码不能为空！");
                    }
                }
            });
        }
    </script>
</head>
<body>
    <form id="loginForm">
        用户名：<input name="userName" /><br/>
        密码：<input name="password" /><br/>
        <input type="button" value="登录" id="loginBtn" onclick="login();">
    </form>
</body>
</html>
